<body>
    <div id="longDesc">
        <h1 style="font-family:Calibri Light; color:#2e74b5; font-size:large">Introduction</h1>
        <div></div>
        <p>
            The<strong> xSqlPs</strong> module is a part of the Windows PowerShell Desired State Configuration (DSC) Resource Kit, which is a collection of DSC Resources produced by the PowerShell Team. This module contains the
            <strong>xSqlServerInstall, xSqlHAService, xSqlHAEndpoint, xSqlHAGroup, and&nbsp;xWaitForSqlHAGroup</strong> resources. This DSC Resource allows you to rename a computer and add it to a domain or workgroup.
        </p>
        <div></div>
        <p>
            <strong>All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service. The &quot;&quot;x&quot; in xSqlPs stands for experimental</strong>, which means that these resources will be
            <strong>fix forward</strong> and monitored by the module owner(s).
        </p>
        <div></div>
        <p>Please leave comments, feature requests, and bug reports in the Q &amp; A tab for this module.</p>
        <div></div>
        <p>
            If you would like to modify <span style="font-family:Calibri; font-size:medium">
                <strong>xSqlPs</strong>
            </span> module, feel free. When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). As specified in the license, you may copy or modify this resource as long as they are used on the
            Windows Platform.
        </p>
        <div></div>
        <p>
            For more information about Windows PowerShell Desired State Configuration, check out the blog posts on the
            <a href="http://blogs.msdn.com/b/powershell/"><span style="color:#0000ff">PowerShell Blog</span></a> (<a href="http://blogs.msdn.com/b/powershell/archive/2013/11/01/configuration-in-a-devops-world-windows-powershell-desired-state-configuration.aspx"><span style="color:#0000ff">this</span></a>
            is a good starting point). There are also great community resources, such as <a href="http://powershell.org/wp/tag/dsc/">
                <span style="color:#0000ff">PowerShell.org</span>
            </a>, or <a href="http://www.powershellmagazine.com/tag/dsc/">
                <span style="color:#0000ff">PowerShell Magazine</span>
            </a>. For more information on the DSC Resource Kit, check out
            <a href="http://go.microsoft.com/fwlink/?LinkID=389546"><span style="color:#0000ff">this blog post</span></a>.
        </p>
        <div></div>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Installation</h1>
        <div></div>
        <p>To install <strong><span style="font-family:Calibri; font-size:medium"><strong>xSqlPs</strong></span></strong> module</p>
        <div></div>
        <div>
            <ul style="list-style-type:disc; direction:ltr">
                <li>Unzip the content under $env:ProgramFiles\WindowsPowerShell\Modules folder </li>
            </ul>
        </div>
        <p>To confirm installation:</p>
        <ul style="list-style-type:disc; direction:ltr">
            <li>
                Run <strong>Get-DSCResource</strong> to see that <span style="font-family:Calibri; font-size:medium">
                    <strong>xSqlServerInstall, xSqlHAService, xSqlHAEndpoint, xSqlHAGroup, xWaitForSqlHAGroup</strong>
                </span> are among the DSC Resources listed
            </li>
        </ul>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Requirements</h1>
        <p>
            This module requires the latest version of PowerShell (v4.0, which ships in Windows 8.1 or Windows Server 2012R2). To easily use PowerShell 4.0 on older operating systems,
            <a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855"><span style="color:#0000ff">install WMF 4.0</span></a>. Please read the installation instructions that are present on both the download page and the release notes for WMF 4.0.
        </p>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Description</h1>
        <p>
            The <strong>xSqlPs </strong>module contains the <span style="font-family:Calibri; font-size:medium">
                <strong>xSqlServerInstall, xSqlHAService, xSqlHAEndpoint, xSqlHAGroup, xWaitForSqlHAGroup</strong>
            </span> DSC Resources. These DSC Resources allow you to install a SQL Server from software stored on a network or local&nbsp;share, enable SQL high avialability
            service(HA), configure SQL HA endpoint.&nbsp;
        </p>
        <p>
            The <span style="font-family:Calibri; font-size:medium">
                <span style="font-family:Calibri; font-size:medium">
                    <strong>
                        xSqlServerInstall
                    </strong>resource is responsible for installing SQL Enterprise on target machine.<span style="font-family:Calibri; font-size:medium">
                        <span style="font-family:Calibri; font-size:medium">
                            <span style="font-family:Calibri; font-size:medium">
                                The
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <strong>
                                            xSqlHAService
                                        </strong>
                                    </span>
                                </span>resource is responsible for enabling SQL high availability (HA) service on a given SQL instance.&nbsp;
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <span style="font-family:Calibri; font-size:medium">
                                            The
                                            <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAEndpoint</strong></span></span> resource is responsible for configuring the given instance of SQL high availability service to listen port
                                            5022 with given name, and assigning users that are allowed to communicate&nbsp;through the SQL endpoint.&nbsp;
                                            <span style="font-family:Calibri; font-size:medium">
                                                <span style="font-family:Calibri; font-size:medium">
                                                    <span style="font-family:Calibri; font-size:medium">
                                                        The
                                                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAGroup</strong></span></span> resource is responsible for configuring an SQL HA group. If the HA group does not exist&nbsp;it will create&nbsp;one
                                                        with the given name on given SQL instance and add the HA group database(s)&nbsp;to local SQL instance.&nbsp;The
                                                        <span style="font-family:Calibri; font-size:medium">
                                                            <span style="font-family:Calibri; font-size:medium">
                                                                <strong>xWaitForSqlHAGroup</strong> resource is responsible for&nbsp;waiting for SQL HA group to be ready&nbsp;by checking the state of the HA group of a
                                                                given name in a given interval till either the HA group is discoverable or the number of retries reached its maximum.
                                                            </span>
                                                        </span>
                                                    </span>
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </span>
                            </span>
                        </span>
                    </span><strong>&nbsp;</strong>
                </span>
            </span>
        </p>
        <p>
            <span style="font-family:Calibri; font-size:medium">
                <span style="font-family:Calibri; font-size:medium">
                    <strong>
                        Note: these resources assume familiarity with certain aspects of the SQL Server install process.&nbsp; SQL Server Enterprise installer requires
                        .NET 3.5 to be installed, therefore DSC resource that installs SQL Enterprise requires Net 3.5 sources&nbsp;to be present on the machine.
                        <br>
                    </strong>
                </span>
            </span>
        </p>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Details</h1>
        <p><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlServerInstall</strong></span></span> resource has following properties:</p>
        <ul style="list-style-type:disc; direction:ltr">
            <li>
                <strong>InstanceName</strong>: <span>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>The name of SQL instance
            </li>
            <li>
                <strong>SourcePath</strong>: <span>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>The share path of SQL server software
            </li>
            <li>
                <strong>SourcePathCredential</strong>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The credential that vm could use to access net share of sql server software.
            </li>
            <li>
                <strong>Features</strong>: <span>
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </span>List of names of Sql Server features to install
            </li>
            <li>
                <strong>SqlAdministratorCredential</strong>: The SQL Server Administrator credential
            </li>
        </ul>
        <div id="longDesc">
            <span style="font-family:Calibri; font-size:medium">
                <p><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAService</strong></span></span> resource has following properties:</p>
                <ul style="list-style-type:disc; direction:ltr">
                    <li>
                        <strong>InstanceName</strong>: <span>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </span>The name of the SQL instance
                    </li>
                    <li>
                        <strong>&nbsp;</strong><span style="font-family:Calibri; font-size:medium"><strong>SqlAdministratorCredential</strong>: The SQL Server Administrator credential</span>
                    </li>
                    <li>
                        <strong>ServiceCredential</strong>: <span>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Domain
                        </span>credential used to run SQL Service
                    </li>
                </ul>
            </span><span style="font-family:Calibri; font-size:medium">
                <p><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAEndpoint</strong></span></span> resource has following properties:</p>
                <ul style="list-style-type:disc; direction:ltr">
                    <li>
                        <strong>InstanceName</strong>: <span>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        </span>The name of the SQL instance
                    </li>
                    <li>
                        <strong>AllowedUser</strong>: <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Unique name for HA database mirroring endpoint of the sql instance.</span>
                    </li>
                    <li>
                        <strong>PortNumber</strong>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; The single port number(nnnn) on which the Sql HA to listen to.
                    </li>
                </ul>
                <span style="font-family:Calibri; font-size:medium">
                    <p><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAGroup</strong></span></span> resource has following properties:</p>
                    <ul style="list-style-type:disc; direction:ltr">
                        <li>
                            <strong>Name</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>The name of the SQL Availability Group
                        </li>
                        <li>
                            <strong>Database</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
                            </span>Array of databases on the local SQL instance.&nbsp; Each database can belong to only one HA group.
                        </li>
                        <li>
                            <strong>ClusterName</strong>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The name of windows failover cluster for the availability group
                        </li>
                        <li>
                            <strong>DatabaseBackupPath</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>The net share for SQL replication initialization
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <strong>InstanceName</strong>:
                                        <span>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        </span>Name of the SQL Instance<br>
                                    </span>
                                </span>
                            </span>
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <strong>EndPointName</strong>:
                                        <span>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        </span>Name of EndPoint to access High Availability sql instance.
                                    </span>
                                </span>
                            </span>
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <span style="font-family:Calibri; font-size:medium">
                                            <span style="font-family:Calibri; font-size:medium">
                                                <span style="font-family:Calibri; font-size:medium">
                                                    <strong>DomainCredential</strong>:
                                                    <span>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    </span>Domain credential could get list of cluster nodes<br>
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </span>
                            </span>
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <span style="font-family:Calibri; font-size:medium">
                                            <span style="font-family:Calibri; font-size:medium">
                                                <span style="font-family:Calibri; font-size:medium">
                                                    <span style="font-family:Calibri; font-size:medium">
                                                        <span style="font-family:Calibri; font-size:medium">
                                                            <span style="font-family:Calibri; font-size:medium">
                                                                <strong>SqlAdministratorCredential</strong>:&nbsp;
                                                                <span>&nbsp;</span>SQL&nbsp;Server Administratory&nbsp;credential
                                                            </span>
                                                        </span>
                                                    </span>
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </span>
                            </span>
                        </li>
                    </ul>
                </span>
            </span>
        </div>
        <div>
            <span style="font-family:Calibri; font-size:medium">
                <span style="font-family:Calibri; font-size:medium">
                    <p><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xWaitForSqlHAGroup</strong></span></span> resource has following properties:</p>
                    <ul style="list-style-type:disc; direction:ltr">
                        <li>
                            <strong>Name</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>The name of SQL High Availability Group
                        </li>
                        <li>
                            <strong>ClusterName</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>The name of windows failover cluster for the availability group.
                        </li>
                        <li>
                            <strong>RetryIntervalSec</strong>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Interval to check the HA group existency
                        </li>
                        <li>
                            <strong>RetryCount</strong>: <span>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            </span>Maximum number of retries to check HA group existency
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <strong>InstanceName</strong>:
                                        <span>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        </span>The name of SQL instance
                                    </span>
                                </span>
                            </span>
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <span style="font-family:Calibri; font-size:medium">
                                            <span style="font-family:Calibri; font-size:medium">
                                                <span style="font-family:Calibri; font-size:medium">
                                                    <strong>DomainCredential</strong>:
                                                    <span>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    </span>Domain credential could get list of cluster nodes
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </span>
                            </span>
                        </li>
                        <li>
                            <span style="font-family:Calibri; font-size:medium">
                                <span style="font-family:Calibri; font-size:medium">
                                    <span style="font-family:Calibri; font-size:medium">
                                        <span style="font-family:Calibri; font-size:medium">
                                            <span style="font-family:Calibri; font-size:medium">
                                                <span style="font-family:Calibri; font-size:medium">
                                                    <span style="font-family:Calibri; font-size:medium">
                                                        <span style="font-family:Calibri; font-size:medium">
                                                            <span style="font-family:Calibri; font-size:medium">
                                                                <strong>SqlAdministratorCredential</strong>:
                                                                <span>&nbsp; </span><span style="font-family:Calibri; font-size:medium">
                                                                    <span style="font-family:Calibri; font-size:medium">
                                                                        <span style="font-family:Calibri; font-size:medium">
                                                                            <span style="font-family:Calibri; font-size:medium">
                                                                                <span style="font-family:Calibri; font-size:medium">
                                                                                    <span style="font-family:Calibri; font-size:medium">
                                                                                        <span style="font-family:Calibri; font-size:medium">
                                                                                            <span style="font-family:Calibri; font-size:medium">
                                                                                                <span style="font-family:Calibri; font-size:medium">
                                                                                                    <span style="font-family:Calibri; font-size:medium">
                                                                                                        <span style="font-family:Calibri; font-size:medium">
                                                                                                            <span style="font-family:Calibri; font-size:medium">
                                                                                                                SQL
                                                                                                                Server Administrator&nbsp;credential
                                                                                                            </span>
                                                                                                        </span>
                                                                                                    </span>
                                                                                                </span>
                                                                                            </span>
                                                                                        </span>
                                                                                    </span>
                                                                                </span>
                                                                            </span>
                                                                        </span>
                                                                    </span>
                                                                </span>
                                                            </span>
                                                        </span>
                                                    </span>
                                                </span>
                                            </span>
                                        </span>
                                    </span>
                                </span>
                            </span>
                        </li>
                    </ul>
                </span>
            </span>
        </div>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Renaming Requirements</h1>
        <p>When making changes to these resources, we suggest the following practice:</p>
        <ol style="list-style-type:decimal; direction:ltr">
            <li>
                Update the following names by replacing MSFT with your company/community name and replacing the
                <strong>&quot;x&quot;</strong> with <strong>&quot;c&quot;</strong> (short for &quot;Community&quot;) or another prefix of your choice:
                <ul>
                    <li><strong>Module name (ex: xSqlPs</strong> becomes <strong>cSqlPs</strong>) </li>
                    <li>
                        <strong>Resource folder (ex: MSFT_<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAGroup</strong></span></span></span></span></span></strong>
                        becomes <strong>Contoso_c<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>)
                    </li>
                    <li>
                        <strong>Resource Name (ex: MSFT_<span style="font-family:Calibri; font-size:medium"><strong>x<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong></span><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>&nbsp;</strong></span></span></span></span></span></strong>
                        becomes <strong>Contoso_c<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>)
                    </li>
                    <li>
                        <strong>
                            Resource Friendly Name (ex: <span style="font-family:Calibri; font-size:medium">
                                <strong>x<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>
                            </span>
                        </strong>
                        becomes <strong>c<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>)
                    </li>
                    <li>
                        <strong>MOF class name (ex: MSFT_<span style="font-family:Calibri; font-size:medium"><strong>x<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong></span></strong>
                        becomes <strong>Contoso_c<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>)
                    </li>
                    <li>
                        <strong>Filename for the &lt;resource&gt;.schema.mof (ex: MSFT_x<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>.schema.mof
                        becomes <strong>Contoso_c<span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>SqlHAGroup</strong></span></span></span></span></span></strong>.schema.mof)
                    </li>
                </ul>
            </li>
            <li>Update module and metadata information in the module manifest </li>
            <li>Update any configuration that use these resources </li>
        </ol>
        <p>
            <em>
                We reserve resource and module names without prefixes (&quot;x&quot; or &quot;c&quot;) for future use (e.g. &quot;MSFT_SqlHAGroup&quot; ).&nbsp; If the next version of Windows Server ships with a &quot;SqlHAGroup&quot; resource, we don't want to break any configurations that use any community
                modifications. Please keep a prefix such as &quot;c&quot; on all community modifications.
            </em>
        </p>
        <h1 style="color:#2e74b5; font-family:Calibri Light; font-size:large">Versions</h1>
        <p>1.0.0.0</p>
        <ul style="list-style-type:disc; direction:ltr">
            <li>
                Initial release with the following resources
                <ul style="list-style-type:circle">
                    <li>
                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlServerInstall</strong></span></span>
                    </li>
                    <li>
                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAService</strong></span></span>
                    </li>
                    <li>
                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAEndpoint</strong></span></span>
                    </li>
                    <li>
                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xSqlHAGroup</strong></span></span>
                    </li>
                    <li>
                        <span style="font-family:Calibri; font-size:medium"><span style="font-family:Calibri; font-size:medium"><strong>xWaitForSqlHAGroup</strong></span></span>
                    </li>
                </ul>
            </li>
        </ul>
        <p>1.1.0.0</p>
        <p>&nbsp;</p>
        <ul>
            <li>
                <span style="font-size:medium">Removed requirement for CredSSP when configuring HA Groups.</span>
            </li>
        </ul>
        <p><span style="font-family:Calibri; font-size:medium">&nbsp;</span></p>
        <p>1.1.1.0</p>
        <p>&nbsp;</p>
        <ul>
            <li>
                <span style="font-size:medium">Fixed a bug in xSQLHAGroup and xWaitForSqlHAGroup when closing tokens, which may have caused the DSC engine to stop process occasionally.</span>
            </li>
        </ul>
        <p><span style="font-size:medium">&nbsp;</span></p>
        <p>1.1.2.0</p>
        <ul>
            <li>
                <span style="font-size:medium">&nbsp;</span><span style="font-size:small">Updated xSQLServerInstall to align with preferred SQL security practices, specifically&nbsp;not adding System account as sysadmin.</span>
            </li>
        </ul>
        <p>1.1.3.0</p>
        <ul>
            <li>
                <span style="font-size:medium">&nbsp;</span><span style="font-size:small">Updated xSqlServerInstall Set-TargetResource to resolve infinite-restart issue reported
            </li>
        </ul>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p><span style="font-family:Calibri; font-size:medium">&nbsp;</span></p>
        <h1 style="margin-bottom:0pt; font-family:Calibri Light; color:#2e74b5; font-size:large">
            Example: Install SQL on a Single Node.
        </h1>
        <div id="longDesc">
            This example installs SQL Server on a single node.&nbsp; Note: this sample has prequisites that must be met before it can be run.&nbsp; It assumes that the .Net 3.5 source is present under C:\Software\sxs, and that the SQL full enterprise
            installer is present under C:\Software\sql, and local self singed certificate is prepared.
        </div>
        <div></div>
        <div>
            <div class="scriptcode">
                <div class="pluginEditHolder" plugincommand="mceScriptCode">
                    <div class="title"><span>PowerShell</span></div>
                    <div class="pluginLinkHolder"><span class="pluginEditHolderLink">Edit</span>|<span class="pluginRemoveHolderLink">Remove</span></div>
                    <span class="hidden">powershell</span>
<pre class="hidden"># Configuration to install Sql server database engine and management tools.
# 
# A. Prepare a local self signed certificate with the following steps:
# 1. Install MakeCert.exe (Microsoft SDK 8.1 http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx)
# 2. Open console with Administrator elevation, run the following:
#     makecert -r -pe -n &quot;CN=DSCDemo&quot; -sky exchange -ss my -sr localMachine
# B. Prepare software and run the configuration.
# 1. On the machine, create a folder as Software
# 2. On the machine, copy Windows Server 2012 R2 source\sxs to C:\Software\sxs
# 3. copy sql full enterprise installation software to C:\Software\sql
# 4. copy xSqlPs to $env:ProgramFiles\WindowsPowershell\Modules
# 5. Copy this file (sql101.ps1) to c:\DSCDemo
# 6. in powershell with administrator elevation, go to c:\DSCDemo, run .\sql101.ps1
$certSubject = &quot;CN=DSCDemo&quot;
$keysFolder = Join-Path $env:SystemDrive -ChildPath &quot;Keys&quot;
$cert = dir Cert:\LocalMachine\My | ? { $_.Subject -eq $certSubject }
if (! (Test-Path $keysFolder ))
{
    md $keysFolder | Out-Null
}
$certPath = Export-Certificate -Cert $cert -FilePath (Join-Path $keysFolder -ChildPath &quot;Dscdemo.cer&quot;)
$ConfigData=
@{
    AllNodes = @(
       @{
           NodeName = &quot;localhost&quot;
           CertificateFile = $certPath
           Thumbprint = $cert.Thumbprint
        }
    )
 }
Configuration Sql101
{
    param(
        [Parameter(Mandatory=$true)]
        [ValidateNotNullorEmpty()]
        [PsCredential] $credential
        )
    Import-DscResource -Module xSqlPs
   Node $AllNodes.NodeName
   {
    
    # Install SQL Server
    WindowsFeature installdotNet35
    {            
        Ensure = &quot;Present&quot;
        Name = &quot;Net-Framework-Core&quot;
        Source = &quot;c:\software\sxs&quot;
    }
        
    xSqlServerInstall installSqlServer
    {
        InstanceName = &quot;PowerPivot&quot;
        SourcePath = &quot;c:\software\sql&quot;
        Features= &quot;SQLEngine,SSMS&quot;
        SqlAdministratorCredential = $credential
        DependsOn = &quot;[WindowsFeature]installdotNet35&quot;
    }
    LocalConfigurationManager 
    { 
        CertificateId = $node.Thumbprint
        RebootNodeIfNeeded = $true
    } 
 }    
}
Sql101 -ConfigurationData $ConfigData -OutputPath .\Mof -credential (Get-Credential -UserName &quot;sa&quot; -Message &quot;Enter password for SqlAdministrator sa&quot;)
Set-DscLocalConfigurationManager .\Mof
Start-DscConfiguration -Path .\Mof -ComputerName localhost -Wait -Verbose</pre>
                    <div class="preview">
<pre class="powershell"><span class="powerShell__com">#&nbsp;Configuration&nbsp;to&nbsp;install&nbsp;Sql&nbsp;server&nbsp;database&nbsp;engine&nbsp;and&nbsp;management&nbsp;tools.</span>&nbsp;
<span class="powerShell__com">#&nbsp;</span>&nbsp;
<span class="powerShell__com">#&nbsp;A.&nbsp;Prepare&nbsp;a&nbsp;local&nbsp;self&nbsp;signed&nbsp;certificate&nbsp;with&nbsp;the&nbsp;following&nbsp;steps:</span>&nbsp;
<span class="powerShell__com">#&nbsp;1.&nbsp;Install&nbsp;MakeCert.exe&nbsp;(Microsoft&nbsp;SDK&nbsp;8.1&nbsp;http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx)</span>&nbsp;
<span class="powerShell__com">#&nbsp;2.&nbsp;Open&nbsp;console&nbsp;with&nbsp;Administrator&nbsp;elevation,&nbsp;run&nbsp;the&nbsp;following:</span>&nbsp;
<span class="powerShell__com">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;makecert&nbsp;-r&nbsp;-pe&nbsp;-n&nbsp;&quot;CN=DSCDemo&quot;&nbsp;-sky&nbsp;exchange&nbsp;-ss&nbsp;my&nbsp;-sr&nbsp;localMachine</span>&nbsp;
&nbsp;
<span class="powerShell__com">#&nbsp;B.&nbsp;Prepare&nbsp;software&nbsp;and&nbsp;run&nbsp;the&nbsp;configuration.</span>&nbsp;
<span class="powerShell__com">#&nbsp;1.&nbsp;On&nbsp;the&nbsp;machine,&nbsp;create&nbsp;a&nbsp;folder&nbsp;as&nbsp;Software</span>&nbsp;
<span class="powerShell__com">#&nbsp;2.&nbsp;On&nbsp;the&nbsp;machine,&nbsp;copy&nbsp;Windows&nbsp;Server&nbsp;2012&nbsp;R2&nbsp;source\sxs&nbsp;to&nbsp;C:\Software\sxs</span>&nbsp;
<span class="powerShell__com">#&nbsp;3.&nbsp;copy&nbsp;sql&nbsp;full&nbsp;enterprise&nbsp;installation&nbsp;software&nbsp;to&nbsp;C:\Software\sql</span>&nbsp;
<span class="powerShell__com">#&nbsp;4.&nbsp;copy&nbsp;xSqlPs&nbsp;to&nbsp;$env:ProgramFiles\WindowsPowershell\Modules</span>&nbsp;
<span class="powerShell__com">#&nbsp;5.&nbsp;Copy&nbsp;this&nbsp;file&nbsp;(sql101.ps1)&nbsp;to&nbsp;c:\DSCDemo</span>&nbsp;
<span class="powerShell__com">#&nbsp;6.&nbsp;in&nbsp;powershell&nbsp;with&nbsp;administrator&nbsp;elevation,&nbsp;go&nbsp;to&nbsp;c:\DSCDemo,&nbsp;run&nbsp;.\sql101.ps1</span>&nbsp;
&nbsp;
&nbsp;
<span class="powerShell__variable">$certSubject</span>&nbsp;=&nbsp;<span class="powerShell__string">&quot;CN=DSCDemo&quot;</span>&nbsp;
<span class="powerShell__variable">$keysFolder</span>&nbsp;=&nbsp;<span class="powerShell__cmdlets">Join-Path</span>&nbsp;<span class="powerShell__variable">$env</span>:SystemDrive&nbsp;<span class="powerShell__operator">-</span>ChildPath&nbsp;<span class="powerShell__string">&quot;Keys&quot;</span>&nbsp;
<span class="powerShell__variable">$cert</span>&nbsp;=&nbsp;<span class="powerShell__alias">dir</span>&nbsp;Cert:\LocalMachine\My&nbsp;<span class="powerShell__operator">|</span>&nbsp;?&nbsp;{&nbsp;<span class="powerShell__variable">$_</span>.Subject&nbsp;<span class="powerShell__operator">-</span>eq&nbsp;<span class="powerShell__variable">$certSubject</span>&nbsp;}&nbsp;
<span class="powerShell__keyword">if</span>&nbsp;(<span class="powerShell__operator">!</span>&nbsp;(<span class="powerShell__cmdlets">Test-Path</span>&nbsp;<span class="powerShell__variable">$keysFolder</span>&nbsp;))&nbsp;
{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;md&nbsp;<span class="powerShell__variable">$keysFolder</span>&nbsp;<span class="powerShell__operator">|</span>&nbsp;<span class="powerShell__cmdlets">Out-Null</span>&nbsp;
}&nbsp;
<span class="powerShell__variable">$certPath</span>&nbsp;=&nbsp;Export<span class="powerShell__operator">-</span>Certificate&nbsp;<span class="powerShell__operator">-</span>Cert&nbsp;<span class="powerShell__variable">$cert</span>&nbsp;<span class="powerShell__operator">-</span>FilePath&nbsp;(<span class="powerShell__cmdlets">Join-Path</span>&nbsp;<span class="powerShell__variable">$keysFolder</span>&nbsp;<span class="powerShell__operator">-</span>ChildPath&nbsp;<span class="powerShell__string">&quot;Dscdemo.cer&quot;</span>)&nbsp;
&nbsp;
&nbsp;
<span class="powerShell__variable">$ConfigData</span>=&nbsp;
@{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;AllNodes&nbsp;=&nbsp;@(&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NodeName&nbsp;=&nbsp;<span class="powerShell__string">&quot;localhost&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CertificateFile&nbsp;=&nbsp;<span class="powerShell__variable">$certPath</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thumbprint&nbsp;=&nbsp;<span class="powerShell__variable">$cert</span>.Thumbprint&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;
&nbsp;}&nbsp;
&nbsp;
Configuration&nbsp;Sql101&nbsp;
{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span class="powerShell__keyword">param</span>(&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Parameter(Mandatory=<span class="powerShell__variable">$true</span>)]&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[ValidateNotNullorEmpty()]&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[PsCredential]&nbsp;<span class="powerShell__variable">$credential</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;Import<span class="powerShell__operator">-</span>DscResource&nbsp;<span class="powerShell__operator">-</span>Module&nbsp;xSqlPs&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;Node&nbsp;<span class="powerShell__variable">$AllNodes</span>.NodeName&nbsp;
&nbsp;&nbsp;&nbsp;{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span class="powerShell__com">#&nbsp;Install&nbsp;SQL&nbsp;Server</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;WindowsFeature&nbsp;installdotNet35&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ensure&nbsp;=&nbsp;<span class="powerShell__string">&quot;Present&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name&nbsp;=&nbsp;<span class="powerShell__string">&quot;Net-Framework-Core&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Source&nbsp;=&nbsp;<span class="powerShell__string">&quot;c:\software\sxs&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;xSqlServerInstall&nbsp;installSqlServer&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InstanceName&nbsp;=&nbsp;<span class="powerShell__string">&quot;PowerPivot&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SourcePath&nbsp;=&nbsp;<span class="powerShell__string">&quot;c:\software\sql&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Features=&nbsp;<span class="powerShell__string">&quot;SQLEngine,SSMS&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SqlAdministratorCredential&nbsp;=&nbsp;<span class="powerShell__variable">$credential</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DependsOn&nbsp;=&nbsp;<span class="powerShell__string">&quot;[WindowsFeature]installdotNet35&quot;</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;
&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;LocalConfigurationManager&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CertificateId&nbsp;=&nbsp;<span class="powerShell__variable">$node</span>.Thumbprint&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RebootNodeIfNeeded&nbsp;=&nbsp;<span class="powerShell__variable">$true</span>&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;
&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}&nbsp;
&nbsp;
Sql101&nbsp;<span class="powerShell__operator">-</span>ConfigurationData&nbsp;<span class="powerShell__variable">$ConfigData</span>&nbsp;<span class="powerShell__operator">-</span>OutputPath&nbsp;.\Mof&nbsp;<span class="powerShell__operator">-</span>credential&nbsp;(<span class="powerShell__cmdlets">Get-Credential</span>&nbsp;<span class="powerShell__operator">-</span>UserName&nbsp;<span class="powerShell__string">&quot;sa&quot;</span>&nbsp;<span class="powerShell__operator">-</span>Message&nbsp;<span class="powerShell__string">&quot;Enter&nbsp;password&nbsp;for&nbsp;SqlAdministrator&nbsp;sa&quot;</span>)&nbsp;
&nbsp;
Set<span class="powerShell__operator">-</span>DscLocalConfigurationManager&nbsp;.\Mof&nbsp;
&nbsp;
Start<span class="powerShell__operator">-</span>DscConfiguration&nbsp;<span class="powerShell__operator">-</span>Path&nbsp;.\Mof&nbsp;<span class="powerShell__operator">-</span>ComputerName&nbsp;localhost&nbsp;<span class="powerShell__operator">-</span>Wait&nbsp;<span class="powerShell__operator">-</span>Verbose</pre>
                    </div>
                </div>
            </div>
            <div class="endscriptcode">&nbsp;</div>
        </div>
        <div class="endscriptcode">&nbsp;</div>
        <p><em>&nbsp;</em><em>&nbsp;</em><em>&nbsp;</em></p>
        <p>&nbsp;</p>

    </div>
</body>
</html>